use master
go

create database House
on
(
name='House',
filename='D:\SQL1\House.mdf',
size=5MB,
maxsize=50MB,
filegrowth=10%
)
log on
(
name='House_log',
filename='D:\SQL1\House_log.ldf',
size=5MB,
maxsize=50MB,
filegrowth=10%
)

use House
go
create table Userinfo
(
UserID int primary key identity(1,1),
UserName nvarchar(10) not null ,
UserTel varchar(20) not null unique
)
create table HouseType
(
TypeID int primary key identity(1,1),
TypName nvarchar(10) not null
)
create table QX
(
qxId int primary key identity(1,1),
qxName nvarchar(10) not null
)
create table HouseInfo
(
id int primary key identity(1,1),
housedesc text,
userid int references userinfo(UserID),
zj nvarchar(20) not null,
shi int not null,
ting int not null,
TypeID int references HouseType(TypeID),
qxId int references QX(qxId)
)